/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Agenda;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 *
 * @author KAREL
 */
public class Deserializacion {
     
    public void Deserializar(String t)
    {
         try {
            //abrir o recuperar archivo de disco
            FileInputStream fis=new FileInputStream("AgendaPerson.ser");
            
            //Stream  para recuperar o reconstruir un objeto
            ObjectInputStream ois= new ObjectInputStream(fis);
            
            //el emtodo readobject() recupera el objeto
           t= (String)ois.readObject();
         
            
            ois.close();
            
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }catch (IOException e){//problema de recuperacion de datos
            e.printStackTrace();
        }catch (ClassNotFoundException e){
            e.printStackTrace();
        }
        
        System.out.println(t);
        
    }
}
